﻿using Gp.Scripts.Core;
using Michsky.UI.Heat;
using UnityEngine;

namespace Gp.Scripts.Core {
    public class SavePanelButton : MonoBehaviour {
        [SerializeField] private ButtonManager button;

        
        public void Init(string fileName) {
            button.onClick.AddListener(() => LoadGame(fileName));
            gameObject.SetActive(true);
        }

        private void LoadGame(string fileName) {
            Global.Get<SaveManager>().LoadGame(fileName);
        }
    }
}